#include "Lexer.h"
#include <iostream>

int main()
{
    std::string sql = R"(
CREATE TABLE users (
    id INT PRIMARY KEY,
    name VARCHAR(50) NOT NULL,
    age INT,
    email VARCHAR(100)
);

INSERT INTO users VALUES (1, 'Alice', 25, 'alice@example.com');
SELECT * FROM users WHERE age > 20;
)";

    MiniDB::Lexer lexer(sql);
    auto tokens = lexer.tokenize();

    std::cout << "词法分析结果:" << std::endl;
    for (const auto &token : tokens)
    {
        if (token.type != MiniDB::TokenType::EOF_TOKEN)
        {
            std::cout << "  " << token.toString() << std::endl;
        }
    }

    return 0;
}
